<?php
abstract class Payment_Adapter_Abstract 
{
    private static $_data;

    public function __set($key,$val)
    {
        self::$_data[$key]=$val; 
    }

    public function __get($key)
    {
        return self::$_data[$key] ? self::$_data[$key] : NULL ; 
    }

    /**
     * setOptions 设置支付接口适配器必要的参数 
     * 
     * @param array $options 
     * @access public
     * @return void
     */
    public function setConfigs($configs)
    {
    
    }

    public function setProductInfo()
    {
    
    }

    public function setOrderInfo()
    {
        
    }

    public function setShippingInfo()
    {
    
    }

    public function setTaxInfo()
    {
    
    }

    public function setAddressInfo()
    {
    
    }
    
    public function setUserInfo()
    {
    
    }

    abstract public function callBack();

    /**
     * log 日志记录 
     * 
     * @param string $message 
     * @param string $priority 
     * @access public
     * @return void
     */
    public function log($message,$priority=null)
    {
        $file = dirname(__FILE__).'/../Log/log'.date('Y-m-d',time()).'.txt';

        $fp = fopen($file,'a');	
	    flock($fp, LOCK_EX) ;
	    fwrite($fp,$message."：执行日期：".strftime("%Y%m%d%H%I%S",time())."\t\n");
	    flock($fp, LOCK_UN); 
	    fclose($fp);
    }
}
?>
